# Create your views here.
from cdsay.picture.models import PhotoModel
from django.shortcuts import render_to_response
from cdsay.picture.form import pictureForm

def uploadPhoto(request):
    if request.method == 'POST':
        form = pictureForm(request.POST)
        model = PhotoModel(
                          title=request.POST.get('title', ''),
                          image=request.POST.get('image', ''),
                          )
        model.save()
    else:
        form = pictureForm()
    return render_to_response('uploadpicture.html', {'form': form})
    